<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
<h:form>
	<p:growl  id="mensagem" showDetail="true" autoUpdate="true"
		closable="true" />

	<p:dataTable id="tabela" selectionMode="single" var="item" value="#{cursoMB.lista}"
		rowKey="#{item.codigo}"  
        selection="#{cursoMB.curso}"	 	
		paginator="true" rows="50" emptyMessage="Não há registros na lista"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
		rowsPerPageTemplate="10,15,25,50,100">
		<f:facet name="header">Lista de Cursos</f:facet>
		<p:column headerText="Código" style="width: 10%;"
			sortBy="#{item.codigo}">
			<h:outputText value="#{item.codigo}" />
		</p:column>
		<p:column headerText="Descrição" style="width: 25%;" sortBy="#{item.descricao}">
			<h:outputText value="#{item.descricao}" />
		</p:column>
		<p:column headerText="Valor do Curso" style="width: 25%;"
			sortBy="#{item.valor}">
			<h:outputText value="#{item.valor}" />
		</p:column>
		
	</p:dataTable>
	
			<p:panelGrid columns="6">
			       <f:facet name="footer">  
        </f:facet>
			<h:commandButton action="#{cursoMB.incluir}" value="Incluir"
				update="tabela" />
			<h:commandButton action="#{cursoMB.alterar}" value="alterar"
				update="tabela" />
			<h:commandButton action="#{cursoMB.consultar}" value="Consultar" />
			<h:commandButton action="#{cursoMB.excluir}" value="Excluir"
				update="tabela" />
			<h:commandButton action="#{cursoMB.sair}" value="Sair"
				update="tabela" />
		</p:panelGrid>


    <p:dialog id="dialog" header="Car Detail" widgetVar="carDialog" resizable="false"  
              width="200" showEffect="clip" hideEffect="fold">  
  
        <h:panelGrid id="display" columns="2" cellpadding="4">  
 
  
            <h:outputText value="Model:" />  
            <h:outputText value="#{cursoMB.curso.descricao}" />  
  
        </h:panelGrid>  
    </p:dialog>  

</h:form>    
</h:body>
</html>